<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<script src="js/global.js"></script>
<script src="js/pw_ajax.js"></script>
<script type="text/javascript">
function checkEmpty() {
	var checkNum = 0;
	var element = document.getElementsByName('houseids[]');
	for (var i=0;i<element.length;i++) {
		if (element[i].checked == true) {
			checkNum += 1;
		}
	}

	if (checkNum == 0) {
		alert('请选择要操作的对象');
		return false;
	} else {
		return confirm('是否确认该操作？');
	}
}
</script>
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="#">出租房源管理</a></li>
	</ul>
</div>

<h2 class="h1">搜索条件</h2>
<form method="post" action="{$baseUrl}">
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr1">
			<td class="td2" width="100">标题或小区名</td>
			<td class="td2" colspan="5"><input type="text" class="input input_wb" value="{$subject}" name="subject" /></td>
		</tr>
		<tr class="tr1">
			<td class="td2">所属区域</td>
			<td class="td2">
			
			<select class="select_wa" name="areatype"  onchange="ajax.send('$baseUrl&action=getplate&areatype='+this.value,'',changeplate)">
			<option value="">所有区域</option>
<!--
EOT;
foreach($areas as $key=>$value){
$select = ($areatype == $key) ? 'selected' : '';
print <<<EOT
-->		
			<option value="{$key}" {$select}>{$value}</option>
<!--
EOT;
}
print <<<EOT
-->			
			</select>
			
			</td>
			<td class="td2">所属板块</td>
			<td class="td2">
			<select class="select_wa" name="platetype" id="platetype">
			<option value="">所有板块</option>
<!--
EOT;
foreach($plates as $key=>$value){
$select = ($platetype == $key) ? 'selected' : '';
print <<<EOT
-->		
			<option value="{$key}" {$select}>{$value}</option>
<!--
EOT;
}
${$top_urgent} = 'selected';
${'state'.$state} = 'selected';
print <<<EOT
-->	
			</select>
				</td>
		</tr>
		<tr class="tr1">
			<td class="td2">推广方式</td>
			<td class="td2">
			
			<select class="select_wa" name="top_urgent">
				<option value="">所有房源</option>
				<option value="none" {$none}>无推广</option>
				<option value="istop" {$istop}>置顶</option>
				<option value="isurgent" {$isurgent}>加急</option>
			</select>
			
			</td>
			<td class="td2">用户名</td>
			<td class="td2"><input type="text" class="input input_wa" name="user" value="{$user}"/></td>
		</tr>
		<tr class="tr1">
			<td class="td2">状态</td>
			<td class="td2">
			
			<select class="select_wa" name="state">
				<option value="0" {$state0}>正常</option>
				<option value="1" {$state1}>下架</option>
				<option value="2" {$state2}>过期</option>
			</select>
			
			</td>
			<td class="td2"></td>
			<td class="td2"></td>
		</tr>
	</table>
</div>

<div class="mb10 tac"><span class="btn"><span><button onfocus="blur();" type="submit">查 找</button></span></span></div>

</form>

<form name="FORM" method="post" action="{$baseUrl}&action=delete">
<input type="hidden" name="returnurl" value="$returnurl">
<h2 class="h1"><span class="fl">出租房源管理</span><span class="fr">[共{$total}条结果]</span></h2>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr2">
			<td width="24">选择</td>
			<td width="350">小区名称</td>
			<td width="100">户型</td>
			<td width="70">租金</td>
			<td width="90">所属区域</td>
			<td width="80">用户名</td>
			<td>操作</td>
		</tr>
<!--
EOT;
if($total){
foreach($result as $key=>$value){
$hireurl = PW_HouseUrl::hireInfo($value['houseid']);
print <<<EOT
-->	
		<tr class="tr1" id="house_tr{$value[houseid]}">
			<td class="td2 tac"><input type="checkbox" value="{$value[houseid]}" name="houseids[]" /></td>
			<td class="td2"><a href="{$hireurl}" target="_blank">{$value[village]}</a></td>
			<td class="td2">{$value[room]}</td>
			<td class="td2">{$value[price]}元/月</td>
			<td class="td2">{$value[areatype]}</td>
			<td class="td2">{$value[username]}</td>
			<td class="td2"><a href="{$hireurl}" class="mr20" target="_blank">[查看]</a><a href="javascript:;" onclick="showDialog('confirm','确认删除该房源?',0,function(){
				ajax.send('{$baseUrl}&action=delete&houseids={$value[houseid]}&from=single','',function(){
					var obj = getObj('house_tr'+{$value[houseid]});
					obj.parentNode.removeChild(obj);
				});
			});" class="mr20">[删除]</a></td>
		</tr>
<!--
EOT;
}
}else{
print <<<EOT
-->
<tr><td class="p10" colspan="9"><div class="admin_tips">啊哦，没有你要的信息！</div></td></tr>
<!--
EOT;
}
print <<<EOT
-->
	</table>

</div>
	{$pages}
<div class="mb10 tac">
	<span class="bt"><span><button onfocus="blur();" onclick="CheckAll(document.FORM);" type="button">全选</button></span></span>
    <span class="btn"><span><button onclick="return checkEmpty()" onfocus="blur();" type="submit">删 除</button></span></span>
</div>
</form>
<script src="mode/house/js/second.js"></script>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->